﻿// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : PhotonServerProject | PhotonServerFramework | IClientPeerFactory.cs
// //  Created : 2016 - 03 - 21 09:54
// //  Modified: 2016 - 04 - 18 09:38
// //  ********************************************************************************

using ExitGames.Logging;
using PhotonServerFramework.Interfaces.Configuration;

namespace PhotonServerFramework.Interfaces.Client
{
    /// <summary>
    ///     Interface for a client peer factory creating either real client peers
    ///     or sub server peers
    /// </summary>
    public interface IClientPeerFactory
    {
        /// <summary>
        ///     Logger instance
        /// </summary>
        ILogger Logger { get; }

        /// <summary>
        ///     Creates a real client peer or a sub server peer depending on the configuration provided
        /// </summary>
        /// <typeparam name="T">Base type of the peer to be created (<see cref="P:Photon.SocketServer.PeerBase" />)</typeparam>
        /// <param name="configuration">
        ///     The configuration of that peer (
        ///     <see cref="S:PhotonServerFramework.Implementation.Configuration.PeerConfiguration" />)
        /// </param>
        /// <returns>Implementation of IClientPeer or IServerPeer depending on the configuration or null in case of an error</returns>
        T CreateClientPeer<T>(IPeerConfiguration configuration) where T : class;
    }
}
